Integrand size = 41, antiderivative size = 128 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {1}{2} a^2 (3 A+4 B+2 C) x+\frac {a^2 (B+2 C) \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 (3 A+2 B-2 C) \sin (c+d x)}{2 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {(A-2 C) \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{2 d} \]
[Out]
Time = 0.32 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.098, Rules used = {4171, 4103, 4081, 3855} \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {a^2 (3 A+2 B-2 C) \sin (c+d x)}{2 d}+\frac {1}{2} a^2 x (3 A+4 B+2 C)-\frac {(A-2 C) \sin (c+d x) \left (a^2 \sec (c+d x)+a^2\right )}{2 d}+\frac {a^2 (B+2 C) \text {arctanh}(\sin (c+d x))}{d}+\frac {A \sin (c+d x) \cos (c+d x) (a \sec (c+d x)+a)^2}{2 d} \]
[In]
[Out]
Rule 3855
Rule 4081
Rule 4103
Rule 4171
Rubi steps \begin{align*} \text {integral}& = \frac {A \cos (c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {\int \cos (c+d x) (a+a \sec (c+d x))^2 (2 a (A+B)-a (A-2 C) \sec (c+d x)) \, dx}{2 a} \\ & = \frac {A \cos (c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {(A-2 C) \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{2 d}+\frac {\int \cos (c+d x) (a+a \sec (c+d x)) \left (a^2 (3 A+2 B-2 C)+2 a^2 (B+2 C) \sec (c+d x)\right ) \, dx}{2 a} \\ & = \frac {a^2 (3 A+2 B-2 C) \sin (c+d x)}{2 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {(A-2 C) \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{2 d}-\frac {\int \left (-a^3 (3 A+4 B+2 C)-2 a^3 (B+2 C) \sec (c+d x)\right ) \, dx}{2 a} \\ & = \frac {1}{2} a^2 (3 A+4 B+2 C) x+\frac {a^2 (3 A+2 B-2 C) \sin (c+d x)}{2 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {(A-2 C) \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{2 d}+\left (a^2 (B+2 C)\right ) \int \sec (c+d x) \, dx \\ & = \frac {1}{2} a^2 (3 A+4 B+2 C) x+\frac {a^2 (B+2 C) \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 (3 A+2 B-2 C) \sin (c+d x)}{2 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {(A-2 C) \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{2 d} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(329\) vs. \(2(128)=256\).
Time = 4.91 (sec) , antiderivative size = 329, normalized size of antiderivative = 2.57 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {a^2 \cos ^2(c+d x) (1+\cos (c+d x))^2 \sec ^4\left (\frac {1}{2} (c+d x)\right ) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \left (2 (3 A+4 B+2 C) x-\frac {4 (B+2 C) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {4 (B+2 C) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {4 (2 A+B) \cos (d x) \sin (c)}{d}+\frac {A \cos (2 d x) \sin (2 c)}{d}+\frac {4 (2 A+B) \cos (c) \sin (d x)}{d}+\frac {A \cos (2 c) \sin (2 d x)}{d}+\frac {4 C \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {4 C \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )}{8 (A+2 C+2 B \cos (c+d x)+A \cos (2 (c+d x)))} \]
[In]
[Out]
Time = 0.34 (sec) , antiderivative size = 124, normalized size of antiderivative = 0.97
method | result | size |
parallelrisch | \(\frac {a^{2} \left (-\cos \left (d x +c \right ) \left (B +2 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\cos \left (d x +c \right ) \left (B +2 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (A +\frac {B}{2}\right ) \sin \left (2 d x +2 c \right )+\frac {A \sin \left (3 d x +3 c \right )}{8}+\frac {3 x d \left (A +\frac {4 B}{3}+\frac {2 C}{3}\right ) \cos \left (d x +c \right )}{2}+\frac {\sin \left (d x +c \right ) \left (A +8 C \right )}{8}\right )}{d \cos \left (d x +c \right )}\) | \(124\) |
derivativedivides | \(\frac {a^{2} A \left (d x +c \right )+B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+C \,a^{2} \tan \left (d x +c \right )+2 a^{2} A \sin \left (d x +c \right )+2 B \,a^{2} \left (d x +c \right )+2 C \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} A \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,a^{2} \sin \left (d x +c \right )+C \,a^{2} \left (d x +c \right )}{d}\) | \(137\) |
default | \(\frac {a^{2} A \left (d x +c \right )+B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+C \,a^{2} \tan \left (d x +c \right )+2 a^{2} A \sin \left (d x +c \right )+2 B \,a^{2} \left (d x +c \right )+2 C \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} A \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,a^{2} \sin \left (d x +c \right )+C \,a^{2} \left (d x +c \right )}{d}\) | \(137\) |
risch | \(\frac {3 a^{2} A x}{2}+2 a^{2} B x +a^{2} x C -\frac {i a^{2} A \,{\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {i a^{2} A \,{\mathrm e}^{i \left (d x +c \right )}}{d}-\frac {i B \,a^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{2} A \,{\mathrm e}^{-i \left (d x +c \right )}}{d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} B \,a^{2}}{2 d}+\frac {i a^{2} A \,{\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}+\frac {2 i C \,a^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{d}+\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{d}-\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{d}\) | \(246\) |
norman | \(\frac {\left (-\frac {3}{2} a^{2} A -2 B \,a^{2}-C \,a^{2}\right ) x +\left (-\frac {3}{2} a^{2} A -2 B \,a^{2}-C \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (\frac {3}{2} a^{2} A +2 B \,a^{2}+C \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (\frac {3}{2} a^{2} A +2 B \,a^{2}+C \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\left (-3 a^{2} A -4 B \,a^{2}-2 C \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (3 a^{2} A +4 B \,a^{2}+2 C \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {a^{2} \left (3 A +2 B -2 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{d}-\frac {4 a^{2} \left (A +B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}+\frac {4 a^{2} \left (3 A +B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {2 a^{2} \left (3 A -2 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {a^{2} \left (5 A +2 B +2 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{3}}+\frac {a^{2} \left (B +2 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a^{2} \left (B +2 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(389\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.02 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {{\left (3 \, A + 4 \, B + 2 \, C\right )} a^{2} d x \cos \left (d x + c\right ) + {\left (B + 2 \, C\right )} a^{2} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (B + 2 \, C\right )} a^{2} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (A a^{2} \cos \left (d x + c\right )^{2} + 2 \, {\left (2 \, A + B\right )} a^{2} \cos \left (d x + c\right ) + 2 \, C a^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \]
[In]
[Out]
\[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=a^{2} \left (\int A \cos ^{2}{\left (c + d x \right )}\, dx + \int 2 A \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int A \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 2 B \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int C \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 C \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int C \cos ^{2}{\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx\right ) \]
[In]
[Out]
none
Time = 0.23 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.18 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{2} + 4 \, {\left (d x + c\right )} A a^{2} + 8 \, {\left (d x + c\right )} B a^{2} + 4 \, {\left (d x + c\right )} C a^{2} + 2 \, B a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, C a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 8 \, A a^{2} \sin \left (d x + c\right ) + 4 \, B a^{2} \sin \left (d x + c\right ) + 4 \, C a^{2} \tan \left (d x + c\right )}{4 \, d} \]
[In]
[Out]
none
Time = 0.34 (sec) , antiderivative size = 198, normalized size of antiderivative = 1.55 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=-\frac {\frac {4 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} - {\left (3 \, A a^{2} + 4 \, B a^{2} + 2 \, C a^{2}\right )} {\left (d x + c\right )} - 2 \, {\left (B a^{2} + 2 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) + 2 \, {\left (B a^{2} + 2 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (3 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 5 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \]
[In]
[Out]
Time = 16.91 (sec) , antiderivative size = 232, normalized size of antiderivative = 1.81 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {3\,A\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+4\,B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )-B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}+2\,C\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )-C\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,4{}\mathrm {i}}{d}+\frac {A\,a^2\,\sin \left (2\,c+2\,d\,x\right )+\frac {A\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{8}+\frac {B\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{2}+\frac {A\,a^2\,\sin \left (c+d\,x\right )}{8}+C\,a^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \]
[In]
[Out]